/////////////////////////////////////////////////////////////////////////
//
// Amuse Engine - graphics\scene
// Copyright (c) 2015.  All Rights Reserved
//
// File:		AE3DObject.cpp
// Author:		Gianluca Belardelli
// Date:		09/04/2015
//
/////////////////////////////////////////////////////////////////////////
#include <AEEngine.h>

AE3DObject::AE3DObject( void ) : m_lpParent( AENULL ),
								m_nFlags( AE3DOBJECT_NONE ),
								m_vcWorldPosition( 0.0f, 0.0f, 0.0f ),
								m_vcOrientation( 0.0f, 0.0f, 0.0f ),
								m_vcMotionDeltaWorldSpaceXYZ( 0.0f, 0.0f, 0.0f ),
								m_vcMotionDeltaLocalSpaceXYZ( 0.0f, 0.0f, 0.0f ),
								m_vcRotationDeltaXYZ( 0.0f, 0.0f, 0.0f ),
								m_vcLocalPosition( 0.0f, 0.0f, 0.0f ),
								m_nModifiedCtr( 0 ),
								m_bUpdateBindingInProgress( AEFALSE )
{
	
}

AE3DObject::~AE3DObject( void )
{
	DetachFromParent();
}

void AE3DObject::SetPosition( const AEVector4f &vcPos )
{
	m_vcWorldPosition = vcPos;
	if( m_lpParent )
	{
		// Ricalcolo la posizione Local	
		//m_lpParent->GetRotationMatrix().
	}
}

void AE3DObject::IncPosition( const AEVector4f &vcPos )
{
	m_vcWorldPosition.Add( vcPos );
	if( m_lpParent )
	{
		// Ricalcolo la posizione Local	
	}	
}

void AE3DObject::GetPosition( AEVector4f &vcPos ) const
{
	vcPos = m_vcWorldPosition;
}
const AEVector4f &AE3DObject::GetPosition( void ) const
{
	return m_vcWorldPosition;
}

void AE3DObject::GetPosition( AEFLOAT32 &fX, AEFLOAT32 &fY, AEFLOAT32 &fZ ) const
{
	fX = m_vcWorldPosition.GetComponent<0>();
	fY = m_vcWorldPosition.GetComponent<1>();
	fZ = m_vcWorldPosition.GetComponent<2>();
}
  
void AE3DObject::SetOrientation( const AEVector4f &vcYPR )
{
	
}

void AE3DObject::IncOrientation( const AEVector4f &vcYPR )
{
	
}

void AE3DObject::GetOrientation( AEVector4f &vcYPR ) const
{
	
}

AEVector4f AE3DObject::GetOrientation( void ) const
{
	return AEVector4f();
}

AEVector4f AE3DObject::GetActualOrientation( void ) const
{
	return AEVector4f();
}

void AE3DObject::GetOrientation( AEFLOAT32 &fY, AEFLOAT32 &fP, AEFLOAT32 &fR ) const
{
	
}

void AE3DObject::SetUseEulerAngles( AEBOOL32 bStatus )
{
	
}

AEBOOL32 AE3DObject::GetUseEulerAngles( void ) const
{
	return AEFALSE;
}

void AE3DObject::SetRotationMatrix( const AEMatrix4f &matMatrix )
{
	
}

void AE3DObject::GetRotationMatrix( AEMatrix4f &matMatrix ) const
{
	
}

void AE3DObject::SetPositionAndRotation( const AEVector4f &vcPos, const AEMatrix4f &matMatrix )
{
	
}

void AE3DObject::SetPositionAndOrientation( const AEVector4f &vcPos, const AEVector4f &vcYPR )
{
	
}

void AE3DObject::EnsureCachedRotationMatrixValid( void ) const
{
	
}

const AEMatrix4f &AE3DObject::GetRotationMatrix( void ) const
{
	return AEMatrix4f();
}

AEMatrix4f AE3DObject::GetTransposedRotationMatrix( void ) const
{
	return AEMatrix4f();
}

AEVector4f AE3DObject::GetDirection( void ) const
{
	return AEVector4f();
}

void AE3DObject::SetDirection( const AEVector4f &vcDir )
{
	
}

void AE3DObject::AttachToParent( AE3DObject *lpParent )
{
	if( m_lpParent )
		DetachFromParent();
		
	m_lpParent = lpParent;
}

void AE3DObject::DetachFromParent( void )
{
	if( m_lpParent )
		m_lpParent = AENULL;
}

AE3DObject *AE3DObject::GetParent( void ) const
{
	return m_lpParent;
}

void AE3DObject::SetLocalPosition( const AEVector4f &vcPos )
{

}

const AEVector4f &AE3DObject::GetLocalPosition( void ) const
{
	return AEVector4f();
}

void AE3DObject::SetLocalOrientation( const AEVector4f &vcYPR )
{  

}

void AE3DObject::SetLocalOrientation( const AEFLOAT32 fY,const AEFLOAT32 fP,const AEFLOAT32 fR )
{

}

AEVector4f AE3DObject::GetLocalOrientation( void ) const
{
	return AEVector4f();
}

void AE3DObject::SetLocalOrientationMatrix( const AEMatrix4f &matMatrix )
{ 

}

void AE3DObject::SetLocalTransform( const AEVector4f &vcPos, const AEMatrix4f &matMatrix )
{

}

const AEMatrix4f &AE3DObject::GetLocalOrientationMatrix( void ) const
{
	return AEMatrix4f();
}

void AE3DObject::ResetLocalTransformation( void )
{

}

void AE3DObject::SetMotionDeltaWorldSpace( const AEVector4f &vcMotionDelta )
{
}
		
void AE3DObject::SetMotionDeltaLocalSpace( const AEVector4f &vcMotionDelta )
{
}

void AE3DObject::IncMotionDeltaWorldSpace( const AEVector4f &vcMotionDelta )
{
}

void AE3DObject::IncMotionDeltaLocalSpace( const AEVector4f &vcMotionDelta )
{
}

const AEVector4f &AE3DObject::GetMotionDeltaWorldSpace( void ) const
{
	return AEVector4f();
}

const AEVector4f &AE3DObject::GetMotionDeltaLocalSpace( void ) const
{
	return AEVector4f();
}

void AE3DObject::ResetMotionDeltaWorldSpace( void )
{
}

void AE3DObject::ResetMotionDeltaLocalSpace( void )
{
}

void AE3DObject::ResetMotionDelta( void )
{
}
